

<!doctype html>
<html ng-app="FilterInControllerModule">
<head>
    <script src="http://code.angularjs.org/1.2.25/angular.min.js"></script>
</head>
<body>
<div ng-controller="FilterController as ctrl">
    <div>
        All entries:
        <span ng-repeat="entry in ctrl.array">{{entry.name}} </span>
    </div>
    <div>
        Entries that contain an "a":
        <span ng-repeat="entry in ctrl.filteredArray">{{entry.name}} </span>
    </div>
</div>
</body>
<script type="text/javascript">


    angular.module('FilterInControllerModule', []).
    controller('FilterController', ['filterFilter', function(filterFilter) {
        this.array = [
            {name: 'asnowwolf'},
            {name: 'why520crazy'},
            {name: 'joe'},
            {name: 'ckken'},
            {name: 'lightma'},
            {name: 'FrankyYang'}
        ];
        this.filteredArray = filterFilter(this.array, 'a');
    }]);


</script>
</html>

